﻿<?xml version="1.0" encoding="utf-8" ?>
<Database Name="MvcEngine" xmlns="http://schemas.microsoft.com/linqtosql/mapping/2007">
	<Table Name="dbo.BlogCategories" Member="MvcEngine.Blog.Models.Entities.BlogCategory">
		<Type Name="MvcEngine.Blog.Models.Entities.BlogCategory">

			<Column Name="Id" Member="Id" IsPrimaryKey="true" DbType="uniqueidentifier" IsDbGenerated="false" CanBeNull="false"/>
			<Column Name="Name" Member="Name" DbType="NVarChar(50)" CanBeNull="false"/>
			<Column Name="ParentId" Member="ParentId" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="BlogId" Member="BlogId" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
			<Column Name="ModifiedDate" Member="ModifiedDate" DbType="DateTime" CanBeNull="false"/>
			<Column Name="Slug" Member="Slug" DbType="NVarChar(256)" CanBeNull="true"/>

			<Association Name="FK_BlogCategories_Blogs"
				  Member="Blogs"
				  ThisKey="BlogId"
				  OtherKey="Id"
				  IsForeignKey="true" />

		</Type>
	</Table>


	<Table Name="dbo.BlogPosts" Member="MvcEngine.Blog.Models.Entities.BlogPost">
		<Type Name="MvcEngine.Blog.Models.Entities.BlogPost">
			<Column Name="Id" Member="Id" IsPrimaryKey="true" DbType="uniqueidentifier" IsDbGenerated="false" CanBeNull="false"/>
			<Column Name="Title" Member="Title" DbType="NVarChar(256)" CanBeNull="false" UpdateCheck="Never"/>
			<Column Name="Description" Member="Description" DbType="NVarChar(Max)" CanBeNull="false" UpdateCheck="Never"/>
			<Column Name="Keywords" Member="Keywords" DbType="NVarChar(Max)" CanBeNull="true" UpdateCheck="Never"/>
			<Column Name="PostContent" Member="PostContent" DbType="NVarChar(Max)" CanBeNull="false" UpdateCheck="Never"/>
			<Column Name="Author" Member="Author" DbType="NVarChar(50)" CanBeNull="false" UpdateCheck="Never"/>
			<Column Name="BlogId" Member="BlogId" DbType="uniqueidentifier" CanBeNull="false" UpdateCheck="Never"/>
			<Column Name="IsCommentEnabled" Member="IsCommentEnabled" DbType="bit" CanBeNull="false" UpdateCheck="Never"/>
			<Column Name="Rating" Member="Rating" DbType="int" CanBeNull="false" UpdateCheck="Never"/>
			<Column Name="Slug" Member="Slug" DbType="NVarChar(256)" CanBeNull="true" UpdateCheck="Never"/>
			<Column Name="PublishedDate" Member="PublishedDate" DbType="DateTime" CanBeNull="true" UpdateCheck="Never"/>
			<Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false" UpdateCheck="Never"/>
			<Column Name="ModifiedDate" Member="ModifiedDate" DbType="DateTime" CanBeNull="false" UpdateCheck="Never"/>


			<Association Name="FK_BlogPosts_Blogs"
				  Member="Blogs"
				  ThisKey="BlogId"
				  OtherKey="Id"
				  IsForeignKey="true" />

		</Type>
	</Table>


	<Table Name="dbo.BlogPostCategories" Member="MvcEngine.Blog.Models.Entities.BlogPostCategory">
		<Type Name="MvcEngine.Blog.Models.Entities.BlogPostCategory">
			<Column Name="Id" Member="Id" IsPrimaryKey="true" DbType="uniqueidentifier" IsDbGenerated="false" CanBeNull="false"/>
			<Column Name="PostId" Member="PostId" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="CategoryId" Member="CategoryId" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
			<Column Name="ModifiedDate" Member="ModifiedDate" DbType="DateTime" CanBeNull="false"/>

			<Association Name="FK_BlogPostCategory_BlogCategories"
				  Member="BlogCategories"
				  ThisKey="CategoryId"
				  OtherKey="Id"
				  IsForeignKey="true" />

			<Association Name="FK_BlogPostCategory_BlogPosts"
				  Member="BlogPosts"
				  ThisKey="PostId"
				  OtherKey="Id"
			      IsForeignKey="true" />
		</Type>
	</Table>


	<Table Name="dbo.BlogPostComments" Member="MvcEngine.Blog.Models.Entities.BlogPostComment">
		<Type Name="MvcEngine.Blog.Models.Entities.BlogPostComment">

			<Column Name="Id" Member="Id" IsPrimaryKey="true" DbType="uniqueidentifier" IsDbGenerated="false" CanBeNull="false"/>
			<Column Name="PostId" Member="PostId" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="ParentCommentId" Member="ParentCommentId" DbType="uniqueidentifier" CanBeNull="true"/>
			<Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
			<Column Name="ModifiedDate" Member="ModifiedDate" DbType="DateTime" CanBeNull="false"/>

			<Column Name="Author" Member="Author" DbType="NVarChar(256)" CanBeNull="false"/>
			<Column Name="Email" Member="Email" DbType="NVarChar(256)" CanBeNull="false"/>
			<Column Name="Website" Member="Website" DbType="NVarChar(256)" CanBeNull="true"/>

			<Column Name="Comment" Member="Comment" DbType="NVarChar(Max)" CanBeNull="false"/>
			<Column Name="Country" Member="Country" DbType="NVarChar(256)" CanBeNull="true"/>
			<Column Name="Ip" Member="Ip" DbType="NVarChar(50)" CanBeNull="false"/>
			<Column Name="IsApproved" Member="IsApproved" DbType="bit" CanBeNull="false"/>

			<Association Name="FK_BlogPostNotify_BlogPosts"
						Member="BlogPosts"
						ThisKey="PostId"
						OtherKey="Id"
						IsForeignKey="true" />
		</Type>
	</Table>


	<Table Name="dbo.BlogPostNotifies" Member="MvcEngine.Blog.Models.Entities.BlogPostNotify">
		<Type Name="MvcEngine.Blog.Models.Entities.BlogPostNotify">
			<Column Name="Id" Member="Id" IsPrimaryKey="true" DbType="uniqueidentifier" IsDbGenerated="false" CanBeNull="false"/>
			<Column Name="PostId" Member="PostId" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="NotifyAddress" Member="NotifyAddress" DbType="NVarChar(256)" CanBeNull="false"/>
			<Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>

			<Association Name="FK_BlogPostNotify_BlogPosts"
				  Member="BlogPosts"
				  ThisKey="PostId"
				  OtherKey="Id"
			      IsForeignKey="true" />
		</Type>
	</Table>

	<Table Name="dbo.BlogTags" Member="MvcEngine.Blog.Models.Entities.BlogTagBase">
		<Type Name="MvcEngine.Blog.Models.Entities.BlogTagBase">
			<Column Name="Id" Member="Id" IsPrimaryKey="true" DbType="uniqueidentifier" IsDbGenerated="false" CanBeNull="false"/>
			<Column Name="BlogId" Member="BlogId" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="Name" Member="Name" DbType="NVarChar(50)" CanBeNull="false"/>
			<Column Name="Slug" Member="Slug" DbType="NVarChar(50)" CanBeNull="false"/>
			<Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
			<Column Name="ModifiedDate" Member="ModifiedDate" DbType="DateTime" CanBeNull="false"/>

			<Association Name="FK_BlogTags_Blogs"
				  Member="Blogs"
				  ThisKey="BlogId"
				  OtherKey="Id"
			      IsForeignKey="true" />
		</Type>
	</Table>

	<Table Name="dbo.BlogPostTags" Member="MvcEngine.Blog.Models.Entities.BlogPostTag">
		<Type Name="MvcEngine.Blog.Models.Entities.BlogPostTag">
			<Column Name="Id" Member="Id" IsPrimaryKey="true" DbType="uniqueidentifier" IsDbGenerated="false" CanBeNull="false"/>
			<Column Name="PostId" Member="PostId" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="TagId" Member="TagId" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
			<Column Name="ModifiedDate" Member="ModifiedDate" DbType="DateTime" CanBeNull="false"/>

			<Association Name="FK_BlogPostTag_BlogPosts"
						Member="BlogPosts"
						ThisKey="PostId"
						OtherKey="Id"
					  IsForeignKey="true" />

			<Association Name="FK_BlogPostTag_BlogTags"
			  Member="BlogTags"
			  ThisKey="TagId"
			  OtherKey="Id"
			  IsForeignKey="true" />
		</Type>
	</Table>

	<Table Name="dbo.Blogs" Member="MvcEngine.Blog.Models.Entities.BlogData">
		<Type Name="MvcEngine.Blog.Models.Entities.BlogData">

			<Column Name="Id" Member="Id" IsPrimaryKey="true" DbType="uniqueidentifier" IsDbGenerated="false" CanBeNull="false"/>
			<Column Name="Name" Member="Name" DbType="NVarChar(256)" CanBeNull="false"/>
			<Column Name="PageId" Member="PageId" DbType="uniqueidentifier" CanBeNull="false"/>
			<Column Name="Fields" Member="Xml" DbType="NVarChar(Max)" CanBeNull="true"/>
			<Column Name="CreatedDate" Member="CreatedDate" DbType="DateTime" CanBeNull="false"/>
			<Column Name="ModifiedDate" Member="ModifiedDate" DbType="DateTime" CanBeNull="false"/>

			<Association Name="FK_Blogs_Pages"
				Member="Pages"
				ThisKey="PageId"
				OtherKey="Id"
				IsForeignKey="true" />
		</Type>
	</Table>

</Database>